package org.itsolutions.javaBackup.gui.web.common.components;

import org.itsolutions.javaBackup.gui.web.common.ApplicationDataHolder;

import com.google.inject.Inject;
import com.vaadin.ui.Embedded;

/**
 * 
 * @author Tomas Fecko
 */
public class JBEmbedded extends Embedded {
	
	private static final long 		serialVersionUID = 2166444172070011258L;
	@Inject ApplicationDataHolder	mAppHolder;

	@Override
	public final String toString() {
		String str = super.toString();
		if (str != null && !str.isEmpty()) {
			return mAppHolder.getString(str);
		} else {
			return null;
		}
	}

	@Override
	public final String getDescription() {
		String desc = super.getDescription();
		if (desc != null && !desc.isEmpty()) {
			return mAppHolder.getString(desc);
		} else {
			return null;
		}
	}

	@Override
	public final String getCaption() {
		String caption = super.getCaption();
		if (caption != null && !caption.isEmpty()) {
			return mAppHolder.getString(caption);
		} else {
			return null;
		}
	}
}




